<?php
class App {
    public function __construct(){
        
    }
    
    public static $defaultDB;
    
    /**
     *@return DBMysql
    */
    public static function getDB(){
        if( !isset(self::$defaultDB)){
            $cfg=Config::load("database");
            self::$defaultDB=new DBMysql(
                $cfg->get("server"),
                $cfg->get("user"),
                $cfg->get("password"),
                $cfg->get("dbname"));
        }
        return self::$defaultDB;
    }
    
    public static function userID(){
        return $_SESSION["user_id"];
    }
    public static function userName(){
        return $_SESSION["user_name"];
    }
    public static function departID(){
        return $_SESSION["depart_id"];
    }
    public static function departName(){
        return $_SESSION["depart_name"];
    }
    public static function tel(){
        return $_SESSION["tel"];
    }
}
